<?php
/**
 * Copyright (c) 2012, xxworkshop Inc.
 * All rights reserved.
 *
 * Created by BrocheXu on 2014.11.6
 */
require_once 'wxhandler/responsehandler/newsresponsehandler.class.php';
require_once 'wxhandler/usermanager.class.php';

class ResponseHandler extends NewsResponseHandler {
	function process($postObject) {
		$usermamager = new UserManager(APPID, APPSECRET);
		$u= $usermamager->getUserInfo($postObject->FromUserName);
		$contents = array();
		$picurls = array('http://cbsnotification.qiniudn.com/19_0_1401440708?imageView2/1/w/320/h/200',
		'http://cbsnotification.qiniudn.com/15_0_1400836499?imageView2/1/w/200/h/200',
		'http://cbsnotification.qiniudn.com/14_0_1400817351?imageView2/1/w/200/h/200');
		for($i=0;$i<3;$i++) {
			$item['title'] = $u['nickname'].$i;
			$item['description'] = 'description'.$i;
			$item['url'] = 'url'.$i;
			$item['picurl'] = $picurls[$i];
			$contents[] = $item;
		}
		return $contents;
	}
}
?>